XMESSAGE

Section: User Commands (1)
Updated: 30 October 1991
Index Return to Main Contents
 

NAME

xmessage - display a message or query in a window (X-based /bin/echo)  

SYNOPSIS

xmessage [ -buttons label1[:value1],label2[:value2],... ] [ options ] -file filename
xmessage [ -buttons label1[:value1],label2[:value2],... ] [ options ] message ...  

DESCRIPTION

Xmessage displays a window containing a message from the command line, a file, or standard input. If the message text doesn't fit entirely within the window scroll bars appear, as necessary, along the left side and below the message, to allow the user to browse through it. Along the lower edge of the message is a row of buttons; clicking the left mouse button on any of these buttons will cause xmessage to exit. Which button was pressed is returned in the exit status and, optionally, by writing the label of the button to standard output.

Xmessage is typically used by shell scripts to display information to the user or to ask the user to make a choice.  

OPTIONS

These are the command line options that xmessage understands.
-buttons button,button,...
This option will cause xmessage to create one button for each comma-separated button argument. The corresponding resource is buttons. Each button consists of a label optionally followed by a colon and an exit value. The label is the name of the Command button widget created and will be the default text displayed to the user. Since this is the name of the widget it may be used to change any of the resources associated with that button. The exit value will be returned by xmessage if that button is selected. The default exit value is 100 plus the button number. Buttons are numbered from the left starting with one. The default string if no -buttons option is given is okay:0.
-default label
Defines the button with a matching label to be the default. If not specified there is no default. The corresponding resource is defaultButton. Pressing Return anywhere in the xmessage window will activate the default button. The default button has a wider border than the others.
-warp label
This will cause the program to warp the cursor to the button with the matching label when the button is first exposed on the screen. The corresponding resource is warpButton. The special value 'default' warps the cursor to the default button.
-columns ncolumns
If non-zero, size the message window to hold ncolumns of text. Default is to size the window to hold the longest line of the message, subject to the minColumns and maxColumns resources.
-lines nlines
If non-zero, size the message window to hold nlines of text. Default is to size the window to hold all lines of the message, subject to the minLines and maxLines resources.
-file filename
File to display. The corresponding resource is file. A filename of `-' reads from standard input. If this option is not supplied, xmessage will display all non-option arguments in the style of echo. Either -file or a message on the command line should be provided, but not both.
-print
This will cause the program to print the label of the button pressed to standard output. Equivalent to setting the printValue resource to TRUE. This is one way to get feedback as to which button was pressed.
 

WIDGET HIERARCHY

Knowing the name and position in the hierarchy of each widget is useful when specifying resources for them. In the chart below, the class and name of each widget is given.

Xmessage (xmessage)
        Form (form)
                AsciiText (text)
                Command (label1)
                Command (label2)
                .
                .
                .
 

RESOURCES

Xmessage has a few top-level application resources that allow customizations that are specific to xmessage.
file
A String resource specifying the file to display.
buttons
A String resource specifying the buttons to display. See the -buttons command-line option.
defaultButton
A String resource specifying the label of the default.
warpButton
A String resource specifying the label of the button to which the cursor should be warped when the button is exposed on the screen.
printValue
A Boolean resource that determines whether or not the label of the button pressed to exit the program is printed. The default is FALSE.
columns
If non-zero, the number of columns for the message window to display, if the -columns option is not specified. Default is to size the window to hold the longest line of the message, subject to the minColumns and maxColumns resources.
minColumns
The minimum number of columns for the message window to display. Default value is 1. This resource limits only the default display size; it has no effect if the -columns option or the columns resource are specified.
maxColumns
The maximum number of columns for the message window to display. Default value is 80. This resource limits only the default display size; it has no effect if the -columns option or the columns resource are specified.
lines
If non-zero, the number of lines for the message window to display, if the -lines option is not specified. Default is to size the window to hold all lines of the message, subject to the minLines and maxLines resources.
minLines
The minimum number of lines for the message window to display. Default value is 1. This resource limits only the default display size; it has no effect if the -lines option or the lines resource are specified.
maxLines
The maximum number of lines for the message window to display. Default value is 20. This resource limits only the default display size; it has no effect if the -lines option or the lines resource are specified.
 

ACTIONS

exit(value)
Exit immediately with an exit status of value (default 0). This action can be used with translations to provide alternate ways of exiting xmessage.
default-exit()
Exit immediately with the exit status specified by the default button, and print the default button's label to standard output if appropriate. If there is no default button, this action has no effect.
 

EXIT STATUS

If it detects an error, xmessage returns 1, so this value should not be used with a button.  

SEE ALSO

X(1), echo(1), cat(1)  

COPYRIGHT

Copyright 1988,1991 Massachusetts Institute of Technology.
See X(1) for a full statement of rights and permissions.  

AUTHORS

Chris Peterson, MIT Project Athena
Stephen Gildea, MIT X Consortium
Conrad Kimball, Boeing Computer Services (adapted from R5 xmessage)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
WIDGET HIERARCHY
RESOURCES
ACTIONS
EXIT STATUS
SEE ALSO
COPYRIGHT
AUTHORS

This document was created by man2html, using the manual pages.
Time: 20:43:40 GMT, June 11, 2022